package org.grey.edz.util;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

/**
 * @program: easy-data-zipper
 * @ClassName EDZReflectUtil
 * @description:
 * @author: Grey
 * @create: 2024-02-19 15:56
 */
public class EDZReflectUtil {

    public static String getter(String property){
        return "get"+property.substring(0,1).toUpperCase() + property.substring(1);
    }

    public static String setter(String property){
        return "set"+property.substring(0,1).toUpperCase() + property.substring(1);
    }

    public static Method method(Class<?> clazz ,String methodName) throws NoSuchMethodException {
        return clazz.getMethod(methodName, clazz);
    }

    public static Field field(Class<?> clazz, String property) throws NoSuchFieldException {
        return clazz.getDeclaredField(property);
    }


}
